/**
 * Created by Administrator on 2015/10/19.
 */

$(function(){
    check();
});
function check(){
    var length = $("#iscroll-dataList li").length;
    if(length <= 5){
        $("#iscroll-pull-up").hide();
    }else{
        $("#iscroll-pull-up").show();
    }
}

var pageNumber = 2;

var br ={
    getData : function(flag) {

        if(flag == 1){//下拉刷新
            $.ajax({
                type: "POST",
                url: "/mobile/order/ajaxTradeOrderService",
                data: {
                    "pageNumber": 1
                },
                async: true,
                success: function(data){
                    $(".list-a").empty();
                    $(".list-a").append(data);
                },
                error: function(){
                    alert("失败");
                }
            });
            check();
        }else{//上拉添加数据
            $.ajax({
                type: "POST",
                url: "/mobile/order/ajaxTradeOrderService",
                data: {
                    "pageNumber": pageNumber
                },
                async: true,
                success: function(data){
                    $(".list-a").append(data);
                },
                error: function(){
                    alert("失败");
                }
            });
            check();
        }
    }
}

